import request from '../index'
import {IPage} from '../user/index'

interface ISourceData {
    Id?:number,
    name:string,
    power:string,
    btnPower:string
    describe:string
}


export function getRoleInfo(pageConfig:IPage,values:any) {
    return request({
        url:"role/info",
        data:{
            values,
            pageConfig
        }
    })
}
// 获取所有的按钮权限


export function getAllBtn() {
    return request({
        url:"role/allBtn",
    })
}


export function addRoleInfo(sourceData:ISourceData) {
    return request({
        url:"role/add",
        data:sourceData
    })
}

export function editRoleInfo(sourceData:ISourceData) {
    return request({
        url:"role/edit",
        data:sourceData
    })
}

export function deleteRoleInfo(Id:number,role:string) {
    return request({
        url:"role/delete",
        data:{
            Id,
            role
        }
    })
}